<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1 {
	width: 195px;
}

.select_width {
	width: 130px;
}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />

<div class="t_bar"><span class="color_red">*</span>签约院士及其科研团队人员情况</div>
<table id="eq_table2" class="t_css" width="100%">
<col style="width: 5%"/>
<col style="width: 5%"/>
<col style="width: 10%"/>
<col style="width: 16%"/>
<col style="width: 20%"/>
<col style="width: 20%"/>
<col style="width: 24%"/>
    <thead >
        <tr style="border:1px solid #B7D1E6">
            <th class="TblHead" align="center">选择</th>
            <th class="TblHead" align="center">序号</th>
            <th class="TblHead" align="center">姓名</th>
            <th class="TblHead" align="center">职务</th>
            <th class="TblHead" align="center">职称</th>
            <th class="TblHead" align="center">从事专业</th>
            <th class="TblHead" align="center">具体负责工作</th>
        </tr>
    </thead>
    <tbody id="tab">
        <tr style="display:none">
            <td align="center">
                <input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selButton2" >
            </td>
            <td align="center">
                <span name="psn_conditions|psn_condition[0]@seq_no" >[index]</span> 
            </td>
            <td align="center">
                <input type="text" name="psn_conditions|psn_condition[0]|name" class="required" maxlength="60" style="width:80%" label="姓名" value="" />
            </td>
            <td align="center">
                <input type="text" name="psn_conditions|psn_condition[0]|job" class="required" maxlength="60" style="width:80%" label="职务" value="" />
            </td>
            <td align="center">
                <cpt:tree key="prof_title" cacheable="false" className="input_css " readonly="true" value="" label="职称" width="50%"
                    id="prof_title[index]" name="prof_title[0]" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValueExt"/>
                <input type="hidden" name="psn_conditions|psn_condition[0]|prof_title_value"  id="prof_title[index]_value" class="required" value=""  label="职称" />
                <input type="hidden" name="psn_conditions|psn_condition[0]|prof_title_name" id="prof_title[index]_name"  value=""/>
            </td>
            <td align="center">
                <input type="text" name="psn_conditions|psn_condition[0]|work_major" class="required" maxlength="40" style="width:80%" label="从事专业" value="" />
            </td>
            <td align="center">
                <input type="text" name="psn_conditions|psn_condition[0]|specific_charge" class="required" maxlength="50" style="width:80%" label="具体负责工作" value="" />
            </td>
        </tr>
    
    
        <c:set value="0" var="index" scope="page"/>
        <x:forEach select="$xmlData/data/psn_conditions/psn_condition" var="psn_condition">
            <c:choose>
                <c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
                <c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
            </c:choose>
            <tr>
                <td align="center">
                    <input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selButton2" >
                </td>
                <td align="center">
                    <span name="psn_conditions/psn_condition[${flag}${index}]@seq_no"><x:out select="$psn_condition/@seq_no"/></span> 
                </td>
                <td align="center">
                    <input type="text" name="psn_conditions/psn_condition[${flag}${index}]/name" value="<x:out select="$psn_condition/name" />"  maxlength="60" class="required" style="width:80%" label="姓名 "/>
                </td>
                <td align="center">
                    <input type="text" name="psn_conditions/psn_condition[${flag}${index}]/job" value="<x:out select="$psn_condition/job" />"  maxlength="60" class="required" style="width:80%" label="职务"/>
                </td>
                <td align="center">
                    <c:set var="nature1">{'id':'<x:out select="$psn_condition/prof_title_value" />','name':'<x:out select="$psn_condition/prof_title_name" />'}</c:set>
                    <cpt:tree key="prof_title" cacheable="false" className="input_css" readonly="true"  value="${nature1}" label="职称"  width="50%"
                        id="prof_title${flag}${index}" name="prof_title${flag}${index}" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValueExt"/>
                    <input type="hidden" id="prof_title${flag}${index}_value" name="psn_conditions/psn_condition[${flag}${index}]/prof_title_value" class="required" value="<x:out select="$psn_condition/prof_title_value" />"  label="职称" />
                    <input type="hidden"id="prof_title${flag}${index}_name"  name="psn_conditions/psn_condition[${flag}${index}]/prof_title_name" value="<x:out select="$psn_condition/prof_title_name" />"/>

                </td>
                <td align="center">
                    <input type="text" name="psn_conditions/psn_condition[${flag}${index}]/work_major" value="<x:out select="$psn_condition/work_major" />"  maxlength="40" class="required" style="width:80%" label="从事专业"/>
                </td>
                <td align="center">
                    <input type="text" name="psn_conditions/psn_condition[${flag}${index}]/specific_charge" value="<x:out select="$psn_condition/specific_charge" />"  maxlength="50" class="required" style="width:80%" label="具体负责工作"/>
                </td>
            </tr>
            <c:set value="${index+1}" var="index" scope="page"/>
        </x:forEach>
    </tbody>
</table>
<table width="98%" align="center">
    <tr>
        <td>
            <input class="button_02" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('eq_table2',999,'签约院士及其科研团队人员情况内容最多只能填写999条')){addNewRow('eq_table2');showDateTag('eq_table2');}try{top.resizeFrame();}catch(e){};">
            <input class="button_02" name="cmdMovePrev" type=button value="上移" onclick="movePrev('eq_table2','selButton2');">
            <input class="button_02" name="cmdMoveNext" type=button value="下移" onclick="moveNext('eq_table2','selButton2');">
            <input class="button_02" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('eq_table2','签约院士及其科研团队人员情况');">
        </td>
    </tr>
</table>
<script>
function initTreeValueExt(treeId, treeNode) {
    if ((treeNode && treeNode.isParent)) {
        scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
        $("#" + treeId).val("");
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val("");
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
        return false;
    }
    var str = treeNode.name;
    var obj = treeNode.parentNode;
    while (obj != null) {
        str = obj.name + "-" + str;
        obj = obj.parentNode;
    }
    
    $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
    $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
    $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
}
</script>